﻿<template>
  <div>
    <!-- 表格 -->
    <template v-if = "element && element.key && element.type == 'table'">
      <div class = 'page_tableContent' style = 'margin-bottom:20px;'>
        <el-table :data = 'element.tableData' :style = "{width: element.options.width}"
        :height = 'element.options.height' :stripe = 'element.options.stripe' :border = 'element.options.border'>
          <el-table-column align = 'center' v-for = '(tableItem, tableIndex) in getTableColumns'
          :key = 'tableIndex' :label = 'tableItem.text'>
            <template slot-scope = 'scope'>
              <span>{{scope.row[tableItem.indexName]}}</span>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </template>
    <!-- echarts图标-折线图 -->
    <template v-else-if = "element && element.key && element.type == 'echarts_line'">
      <div class = 'bi_echartContent bi_echartContent_show' :style = "{height: element.options.height + 'px'}">
        <MainEcharts :ref = 'element.model' :id = "element.model + '_preview'" :className = "element.model + '_classPreview'" :option = 'element.dataOptions'></MainEcharts>
      </div>
    </template>
    <!-- echarts图标-柱状图 -->
    <template v-else-if = "element && element.key && element.type == 'echarts_bar'">
      <div class = 'bi_echartContent bi_echartContent_show' :style = "{height: element.options.height + 'px'}">
        <MainEcharts :ref = 'element.model' :id = "element.model + '_preview'" :className = "element.model + '_classPreview'" :option = 'element.dataOptions'></MainEcharts>
      </div>
    </template>
    <!-- echarts图标-饼图 -->
    <template v-else-if = "element && element.key && element.type == 'echarts_pie'">
      <div class = 'bi_echartContent bi_echartContent_show' :style = "{height: element.options.height + 'px'}">
        <MainEcharts :ref = 'element.model' :id = "element.model + '_preview'" :className = "element.model + '_classPreview'" :option = 'element.dataOptions'></MainEcharts>
      </div>
    </template>
  </div>
</template>

<script src = './biDashboardMenuItem.js'></script>
